﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
     
    class Program
    {
        static void Main(string[] args)
        {
            int[] values = { 1, 34, 56, 100 };
            Utility.Calculate(values, Double);
            string[] strvalues = { "123", "456", "789" };
            Utility.Calculate(strvalues, pStr);
            Console.ReadKey();
        }
        static int Double(int x) { return x * 2; }
        static string pStr(string x) { return x.PadLeft(6, '0'); }
    }

    public class Utility
    {
        public static void Calculate<T>(T[] values, Func<T, T> c)
        {
            for (int i = 0; i < values.Length; i++)
            {
                values[i] = c(values[i]);
                Console.WriteLine(values[i]);
                System.Threading.Thread.Sleep(100);
            }
        }
    }
}
